home *** CD-ROM | disk | FTP | other *** search
-
- ----------
-
- Listing 6 - class definition for lns using a pair of pointers
-
- //
- // lns1b.h - line number sequence interface
- //
- #ifndef LNS_H_INCLUDED
- #define LNS_H_INCLUDED
-
- class lns
- {
- public:
- lns(unsigned n);
- ~lns();
- void add(unsigned n);
- void print();
- private:
- class node;
- node *first, *last;
- };
-
- class lns::node
- {
- public:
- node(unsigned n);
- unsigned number;
- node *next;
- };
-
- inline lns::node::node(unsigned n)
- : number(n), next(0)
- {
- }
-
- #endif
-
-